<template>
	<div>
		<div v-show="true" class="" style="width: 100%;height: 100%; position:fixed;left:0;top:0;background-color: rgba(0,0,0,0.1);display: flex;justify-content: center;align-items: center;z-index: 350;">
			<mu-circular-progress :size="24" color="green500" />
		</div>
	</div>
</template>

<style>
	.amap-demo {
		height: 300px;
	}
</style>

<script>
	module.exports = {
		data() {
			let self = this;
			return {
				token: null
			};
		},
		mounted() {
			let self = this
			localStorage.token = this.$route.query.token
			//console.info(localStorage.token)

			self.axios.post('gaokao-api/api/tokenLogin', {
				'token': localStorage.token,
			}).then(function(response) {
				if(response.data.code == 0) {
					if(response.data.user.mobile == null) {
						setTimeout(function() {
							self.$router.push("binding")
						}, 1480)
					} else {
						setTimeout(function() {
							localStorage.wenlike = response.data.user.wenlike
							if(response.data.user.level == 0) {
								self.$router.push("selectPage")
							} else if(response.data.user.level == 1) {
								self.$router.push("vip_selectPage")
							}
						}, 1480)
					}
				} else {
					setTimeout(function() {
						window.location.href = "http://wechatsip.natapp1.cc/gaokao-api/wechat/authorize?returnUrl=http://wechatsip.natapp1.cc"
					}, 1480)
				}
			}).catch(function(error) {
				console.log(error)
				//that.$message({type: 'info',message: '登录失败，请重新登录',duration:1500});
			})
		},
	};
</script>